#include<iostream>
#include<cctype>
using namespace std;
int main(){
	string s1;
	char a,d;
	int b,c,count = 0;
	while(cin >> b >> a >> c >> d >> s1)
	{
		if(isdigit(s1[0]) == 0) continue;
		else 
		{
		if(a == '+')
		{
			if(b + c == stoi(s1)) count++;
		}
		else if(b - c == stoi(s1)) count++;
		}
	}
	cout << count;
	return 0;
}
